﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace ChoMy.Models.Data
{
    public class BlogCategory
    {
        [Key]
        public int Id { get; set; }
        public string NameId { get; set; }

        public string DisplayName { get; set; }
        public string Name { get; set; }
        public string Description { get; set; }
        public int Level { get; set; }
        public int Priority { get; set; }
        public string ImageUrl { get; set; }

        public bool IsDelete { get; set; }
        public DateTime DateCreated { get; set; }
        public DateTime? DateModified { get; set; }
        public string CreatedBy { get; set; }
        public string ModifiedBy { get; set; }

        public int? ParentId { get; set; }
        public virtual BlogCategory Parent { get; set; }

        public virtual List<BlogPost> BlogPosts { get; set; }

        public BlogCategory()
        {
            Level = 1;
            Priority = 0;
            IsDelete = false;
            DateCreated = DateTime.Now;
            CreatedBy = HttpContext.Current.User.Identity.Name;
        }
    }
}